﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Jhong.FunMVC.Test.Controllers
{

    public class SessionController : Controller
    {

        public ActionResult S1()
        {
            this.SetSession("name", "小蝶惊鸿");
            this.SetSession("remark", "可以看到session了");
            this.SetSession("time", DateTime.Now);
            return Content("<script>location.href='/Session/S2'</script>");
        }

        public ActionResult S2()
        {
            var name = this.GetSession("name");
            var remark = this.GetSession("remark");
            var time = (DateTime)this.GetSession("time");
            return Content(string.Format("name:{0}----remark:{1}-----time:{2}", name, remark, time.ToLongTimeString()));
        }

        public ActionResult S3()
        {
            return null;
        }



    }
}